package ntue.dtd;

import ntue.dtd.account.LoginManager;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Android_for_demoActivity extends Activity {

	private static EditText IDText;
	private static EditText PWText;
	private Button login;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		mainViews();
		

	}

	private void mainViews() {
		IDText = (EditText) findViewById(R.id.ID);
		PWText = (EditText) findViewById(R.id.PW);
		login = (Button) findViewById(R.id.button1);
		IDText.setAlpha(100);
	}
	
	/**按鍵觸發-帳密輸入*/
	public void UserLoginClick(View v){
		boolean LoginStatus = LoginManager.Login(IDText.getText().toString(), PWText.getText().toString());
		// 如果驗證成功 就跳下一頁
		if(LoginStatus){
			Intent intent = new Intent();
			intent.setClass(Android_for_demoActivity.this, Map_page.class);
			startActivity(intent);
			Android_for_demoActivity.this.finish();
		}
	}
	
}